<?php
/**
 * Description: 获取邀请码说明
 * User: devforma
 * Date: 16/6/27
 * Time: 12:17
 */

class GetInviteDesc implements iController {

    /**
     * api请求处理主函数
     * @param array $queryArgs 就是$_REQUEST变量
     * @return array api返回结果，必须含response_code
     */
    public function output($queryArgs) {
        $inviteDesc = getOption('order_invitecode_desc');
        $qqDesc = getOption('order_qq_desc');
        $qq = getOption('service_qq');
        $inviteExplain = getOption('invite_explain');

        $inviteExplain = str_replace('xxx', $qq, $inviteExplain);
        $inviteExplain = str_replace("\r\n", '<br />', $inviteExplain);
        $inviteExplain = str_replace("\n", '<br />', $inviteExplain);

        return genOutput(1, [
            'invitecode_desc' => $inviteDesc,
            'qq_desc' => $qqDesc,
            'coursedetail_desc' => $inviteExplain
        ]);
    }
}